'''
Created on 2012-9-5

@author: Administrator
'''
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import webapp

from controller.handlers import CommentHandler
from controller.handlers import RequestCommentHandler
from controller.handlers import IndexHandler
from controller.handlers import DefaultHandler
from controller.handlers import AboutHandler
from controller.handlers import ContactHandler
from controller.handlers import LifeHandler
from controller.handlers import BlogHandler
from controller.handlers import LoginPageHandler
from controller.handlers import AdminHandler
from controller.pervlets import SaveNewBlogPervlet
from controller.pervlets import DeleteBlogPervlet
from controller.handlers import TestReqHandler
from controller.pervlets import ContactMeHandler
from controller.pervlets import BlogComment
from controller.pervlets import PictureUploader
from controller.pervlets import PictureExhibiter
from controller.pervlets import LifeDeleter

'''
    actions
'''
do_pervlets = [( '/savenewblogform', SaveNewBlogPervlet ), ( '/deleteblog', DeleteBlogPervlet )]

'''
    renders
'''
pervlets = [('/lifedeleter',LifeDeleter),
            ( '/exhibitpicture', PictureExhibiter ),
            ( '/pictureupload', PictureUploader ),
            ( '/postcomment', BlogComment ),
            ( '/comment.html', CommentHandler ),
            ( '/contactrequest', ContactMeHandler ),
            ( '/deleteblog', DeleteBlogPervlet ),
            ( '/savenewblogform', SaveNewBlogPervlet ) ,
            ( '/login', AdminHandler ),
            ( '/login.html', LoginPageHandler ),
            ( '/index.html', IndexHandler ),
            ( '/about.html', AboutHandler ),
            ( '/contact.html', ContactHandler ),
            ( '/life.html', LifeHandler ),
            ( '/blog.html', BlogHandler ),
            ( '/docomment.pervlet', CommentHandler ),
            ( '/getcomment.pervlet', RequestCommentHandler ) ]
pervlets.append( ( '/.*'  , DefaultHandler ) )
#pervlets.extend( do_pervlets )
application = webapp.WSGIApplication( pervlets, debug = True )

def main():
    run_wsgi_app( application )

if __name__ == "__main__":
    main()
